from apscheduler.triggers.cron import CronTrigger

from .urls import scheduler


def runDeployMent():
    print("test deployMent")


def addJob(jobid, cronString="0 0 1-15 * *"):
    # scheduler.add_job(runDeployMent, "cron", id=jobid, hour=hour, minute=minute, seconds=seconds, args=[])
    scheduler.add_job(runDeployMent, CronTrigger.from_crontab(cronString, timezone="Asia/Shanghai"), id=jobid,
                      replace_existing=True, args=[])


def delJob(jobid):
    scheduler.remove_job(jobid)

